#include<iostream>
#include<vector>
using namespace std;

vector<int> grayCode(int n) {
    vector<int> ret(1 << n);
    for (int i = 0; i < ret.size(); i++)
    {
        ret[i] = (i >> 1) ^ i;
    }
    return ret;


}


int main()
{
    vector<int> sum = grayCode(2);
    for (auto i : sum)
    {
        cout << i << " ";
    }
    
    return 0;
}